package learnjava.interview;

import java.util.ArrayList;
import java.util.Scanner;

public class XieCheng {

    public static String m1(){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int d = sc.nextInt();
        ArrayList<int[]>[] record = new ArrayList[n-1];
        for (int i = 0; i < n-1; i++) { //每次读一行
            int si = sc.nextInt();
//            ArrayList<int[]> cur =
        }
        return null;
    }

    public static String m2(){
        Scanner sc = new Scanner(System.in);
        String key = sc.nextLine();
        String lock = sc.nextLine();
        StringBuilder ans = new StringBuilder();
        int i = 0, j = 0;
        while (i<key.length()){
            //寻找第一个和key[i]相同的字符
            char target = key.charAt(i);
            while (lock.charAt(j)!=target) j++;
            ans.append(lock.charAt(++j));
            i++;
            j++;
        }
        return ans.toString();
    }

    public static void main(String[] args) {

        System.out.println(m2());
    }

}
